﻿package Hxw3DEngine.core.materials
{
	import Hxw3DEngine.core.materials.shader.DiffuseShader;
	import Hxw3DEngine.core.Resource.texture.ResourceTexture;
	import Hxw3DEngine.core.Resource.geometry.ResourceGeometry;
	import flash.display3D.Context3D;
	import flash.display3D.Context3DBlendFactor;
	import flash.display3D.Context3DCompareMode;
	import flash.display.*;
	import flash.geom.*;
	import Hxw3DEngine.core.materials.shader.Shader3D;
	import Hxw3DEngine.proxy.Stage3DProxy;
	
	public class TextureMaterial extends Material3D
	{
		
		private var _texture:ResourceTexture;
		public function get texture():ResourceTexture
		{
			return _texture;
		}
		
		public function set texture(value:ResourceTexture):void
		{
			_texture = value;
		}
		
		
		
		public function TextureMaterial(_diffuseTexture:ResourceTexture = null, _shader:Shader3D = null)
		{
			super(_shader);
			texture = _diffuseTexture;
			if(shader == null){
				shader = new DiffuseShader();
				DiffuseShader(shader).texture = texture;
			}
		}
		
		override public function draw(geometry:ResourceGeometry,context:Context3D):void
		{
			super.draw(geometry,context);
		}
		
		
	
	}
}
